/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package entityBeans;

import java.io.Serializable;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 *
 * @author allankv
 */
@Entity
@Table(name = "behavior")
@NamedQueries({
    @NamedQuery(name = "Behavior.findAll", query = "SELECT b FROM Behavior b"),
    @NamedQuery(name = "Behavior.findByIdbehavior", query = "SELECT b FROM Behavior b WHERE b.idbehavior = :idbehavior"),
    @NamedQuery(name = "Behavior.findByBehavior", query = "SELECT b FROM Behavior b WHERE b.behavior = :behavior")})
public class Behavior implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "idbehavior")
    private Integer idbehavior;
    @Column(name = "behavior")
    private String behavior;
    @OneToMany(mappedBy = "behavior", fetch = FetchType.LAZY)
    private List<Occurrenceelement> occurrenceelementList;

    public Behavior() {
    }

    public Behavior(Integer idbehavior) {
        this.idbehavior = idbehavior;
    }

    public Behavior(Integer idbehavior, String behavior) {
        this.idbehavior = idbehavior;
        this.behavior = behavior;
    }

    public Integer getIdbehavior() {
        return idbehavior;
    }

    public void setIdbehavior(Integer idbehavior) {
        this.idbehavior = idbehavior;
    }

    public String getBehavior() {
        return behavior;
    }

    public void setBehavior(String behavior) {
        this.behavior = behavior;
    }

    public List<Occurrenceelement> getOccurrenceelementList() {
        return occurrenceelementList;
    }

    public void setOccurrenceelementList(List<Occurrenceelement> occurrenceelementList) {
        this.occurrenceelementList = occurrenceelementList;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idbehavior != null ? idbehavior.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Behavior)) {
            return false;
        }
        Behavior other = (Behavior) object;
        if ((this.idbehavior == null && other.idbehavior != null) || (this.idbehavior != null && !this.idbehavior.equals(other.idbehavior))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "entityBeans.Behavior[idbehavior=" + idbehavior + "]";
    }

}
